<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Shapes Module Level 2</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="exploring" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="This draft contains the features of CSS relating to wrapping content around and inside shapes. It (implicitly for now) includes and extends the functionality of CSS Shapes Level 1 [[CSS-SHAPES]]. The main points of extension compared to level 1 include additional ways of defining shapes, defining an exclusion area using a shape, and restricting an element&apos;s content area using a shape." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://www.w3.org/TR/css-shapes-2/" rel="canonical">
<style type="text/css">
	.singleImgExample {
		display: block;
		margin: auto;
	}

	.example-table {
		table-layout: fixed;
		width: 100%;
	}

	.example-table tr td img {
		width: 90%;
	}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Shapes Module Level 2</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-shapes-2/">https://drafts.csswg.org/css-shapes-2/</a>
      <dt>Latest published version:
      <dd><a href="https://www.w3.org/TR/css-shapes-2/">https://www.w3.org/TR/css-shapes-2/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="49885"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com">Rossen Atanassov</a> (<span class="p-org org">Microsoft Corporation</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="46659"><a class="p-name fn u-email email" href="mailto:stearns@adobe.com">Alan Stearns</a> (<span class="p-org org">Adobe Systems, Inc.</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-shapes-2/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-shapes-2">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This draft contains the features of CSS relating to wrapping content around and inside shapes. It (implicitly for now) includes and extends the functionality of CSS Shapes Level 1 <a data-link-type="biblio" href="#biblio-css-shapes">[CSS-SHAPES]</a>. The main points of extension compared to level 1 include additional ways of defining shapes, defining an exclusion area using a shape, and restricting an element’s content area using a shape.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-shapes” in the title,
	preferably like this:
	“[css-shapes] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
    <li><a href="#terminology"><span class="secno">2</span> <span class="content"> Terminology</span></a>
    <li><a href="#shapes"><span class="secno">3</span> <span class="content"> Shapes</span></a>
    <li>
     <a href="#basic-shape-functions"><span class="secno">4</span> <span class="content"> Basic Shapes</span></a>
     <ol class="toc">
      <li><a href="#supported-basic-shapes"><span class="secno">4.1</span> <span class="content"> Supported Shapes</span></a>
     </ol>
    <li><a href="#referencing-svg-shapes"><span class="secno">5</span> <span class="content"> Referencing SVG shapes</span></a>
    <li><a href="#shapes-from-image"><span class="secno">6</span> <span class="content"> Shapes from Image</span></a>
    <li><a href="#shapes-from-box-values"><span class="secno">7</span> <span class="content"> Shapes from Box Values</span></a>
    <li>
     <a href="#declaring-shapes"><span class="secno">8</span> <span class="content"> Declaring Shapes</span></a>
     <ol class="toc">
      <li><a href="#shape-outside-property"><span class="secno">8.1</span> <span class="content"> The <span class="property">shape-outside</span> Property</span></a>
      <li><a href="#shape-inside-property"><span class="secno">8.2</span> <span class="content"> The <span class="property">shape-inside</span> Property</span></a>
      <li><a href="#shape-image-threshold-property"><span class="secno">8.3</span> <span class="content"> The shape-image-threshold Property</span></a>
      <li><a href="#shape-image-source-type-property"><span class="secno">8.4</span> <span class="content"> The shape-image-source-type Property</span></a>
      <li><a href="#shape-margin-property"><span class="secno">8.5</span> <span class="content"> The <span class="property">shape-margin</span> property</span></a>
      <li><a href="#shape-padding-property"><span class="secno">8.6</span> <span class="content"> The <span class="property">shape-padding</span> Property</span></a>
     </ol>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p><em>This section is not normative.</em></p>
   <p>Level 1 of this specification
	defined properties to control
	the geometry of an element’s <span>float area</span>.
	This level defines how shapes apply to exclusions.
	It also includes a <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside">shape-inside</a> property
	for applying a shape
	to an element’s content area.
	And finally it defines new ways
	of specifying shapes for all
	of these applications.</p>
   <h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content"> Terminology</span><a class="self-link" href="#terminology"></a></h2>
   <p><dfn data-dfn-type="dfn" data-noexport id="exclusion-area">Exclusion area<a class="self-link" href="#exclusion-area"></a></dfn></p>
   <p>The area used for excluding
	inline flow content
	around an exclusion box.
	The <span>exclusion area</span> is equivalent to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-3/#border-box" id="ref-for-border-box">border box</a> for an exclusion box.
	This specification’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside" id="ref-for-propdef-shape-outside">shape-outside</a> property
	can be used to define arbitrary,
	non-rectangular <span>exclusion areas</span>.
	The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside①">shape-inside</a> property also defines
	an <span>exclusion area</span>,
	but in this case it is the area outside the shape
	that inline content avoids.</p>
   <p><dfn data-dfn-type="dfn" data-noexport id="float-area">Float area<a class="self-link" href="#float-area"></a></dfn></p>
   <p>The area used for wrapping content
	around a float element.
	By default,
	the float area is
	the float element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-3/#margin-box" id="ref-for-margin-box">margin box</a>.
	This specification’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside" id="ref-for-propdef-shape-outside①">shape-outside</a> property
	can be used to define arbitrary,
	non-rectangular float areas.</p>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="content-area">Content area</dfn></p>
   <p>The <a data-link-type="dfn" href="#content-area" id="ref-for-content-area">content area</a> is normally used for layout of the inline flow content of a box.</p>
   <div class="issue-marker" data-bug_id="15089" data-bug_status="NEW">
     <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15089">Issue-15089</a> 
    <div class="issue-details">
     <p class="short-desc">shrink-to-fit circle / shape</p>
    </div>
   </div>
   <h2 class="heading settled" data-level="3" id="shapes"><span class="secno">3. </span><span class="content"> Shapes</span><a class="self-link" href="#shapes"></a></h2>
   <p>Shapes define arbitrary geometric contours
	around which inline content flows.
	The shape-outside property defines
	the <span>float area</span> for a float,
	and the exclusion area for an exclusion.</p>
   <h2 class="heading settled" data-level="4" id="basic-shape-functions"><span class="secno">4. </span><span class="content"> Basic Shapes</span><a class="self-link" href="#basic-shape-functions"></a></h2>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#basic-shape-functions">level 1</a> section.</p>
   <h3 class="heading settled" data-level="4.1" id="supported-basic-shapes"><span class="secno">4.1. </span><span class="content"> Supported Shapes</span><a class="self-link" href="#supported-basic-shapes"></a></h3>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#basic-shape-functions">level 1</a> section, with the following integrated.</p>
   <dl>
    <dt>
<pre class="prod"><dfn data-dfn-type="function" data-export id="funcdef-path">path()<a class="self-link" href="#funcdef-path"></a></dfn> = path( [<a class="production" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-fill-rule" id="ref-for-typedef-fill-rule">&lt;fill-rule></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma">,</a>]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value" id="ref-for-string-value">&lt;string></a> )
</pre>
    <dd>
     <ul>
      <li> <dfn class="css" data-dfn-for="path()" data-dfn-type="value" data-export id="valdef-path-fill-rule"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-fill-rule" id="ref-for-typedef-fill-rule①">&lt;fill-rule></a><a class="self-link" href="#valdef-path-fill-rule"></a></dfn> -
					The filling rule used
					to determine the interior
					of the path.
					See <a href="https://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a> property
					in SVG for details.
					Possible values are <dfn class="dfn-paneled css" data-dfn-for="path()" data-dfn-type="value" data-export id="valdef-path-nonzero"><a class="css" data-link-type="maybe" href="#valdef-path-nonzero" id="ref-for-valdef-path-nonzero">nonzero</a></dfn> or <dfn class="dfn-paneled css" data-dfn-for="path()" data-dfn-type="value" data-export id="valdef-path-evenodd"><a class="css" data-link-type="maybe" href="#valdef-path-evenodd" id="ref-for-valdef-path-evenodd">evenodd</a></dfn>.
					Default value when omitted is <a class="css" data-link-type="maybe" href="#valdef-path-nonzero" id="ref-for-valdef-path-nonzero①">nonzero</a>. 
      <li> The <dfn class="css" data-dfn-for="path()" data-dfn-type="value" data-export id="valdef-path-string"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value" id="ref-for-string-value①">&lt;string></a><a class="self-link" href="#valdef-path-string"></a></dfn> represents an <a href="https://www.w3.org/TR/SVG11/paths.html#PathData">SVG Path data string</a>.
					The path data string must be conform
					to the grammar and parsing rules of SVG 1.1.
					The initial position is defined
					by the first “move to” argument
					in the path string.
					For the initial direction follow SVG 1.1. 
     </ul>
   </dl>
   <div class="issue-marker wrapper">
    <div class="issue-marker" data-bug_id="16448" data-bug_status="ASSIGNED">
      <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16448">Issue-16448</a> 
     <div class="issue-details">
      <p class="short-desc">Should we revisit the decision to not allow SVG path syntax in the shape-inside, shape-outside properties</p>
     </div>
    </div>
   </div>
   <h2 class="heading settled" data-level="5" id="referencing-svg-shapes"><span class="secno">5. </span><span class="content"> Referencing SVG shapes</span><a class="self-link" href="#referencing-svg-shapes"></a></h2>
   <p>An SVG shape can be referenced using the <code>url()</code> syntax.
	The shape can be any
	of the <a href="https://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a> or a <a href="https://www.w3.org/TR/SVG/paths.html">path element</a>.</p>
   <div class="example" id="example-3b616eff">
    <a class="self-link" href="#example-3b616eff"></a> 
    <div style="float:right"> <img alt="results of referencing SVG shapes" src="images/svg-shape-reference.png"> </div>
     <code class="html"><pre>&lt;style>
div {
	height: 400px;
	width: 400px;
}
.in-a-circle {
	shape-outside: url(#circle_shape);
}

<p>.in-a-path {
	shape-outside: url(#path-shape);
}</p>

<p>&lt;/style></p>

<p>&lt;svg ...>
&lt;circle id="circle_shape" cx="50%" cy="50%" r="50%" />
&lt;path id="path-shape" d="M 100 100 L 300 100 L 200 300 z" />
&lt;/svg></p>

<p>&lt;div class="around-a-circle">...&lt;/div>
&lt;div class="around-a-path">...&lt;/div></p>
</pre></code> 
   </div>
   <h2 class="heading settled" data-level="6" id="shapes-from-image"><span class="secno">6. </span><span class="content"> Shapes from Image</span><a class="self-link" href="#shapes-from-image"></a></h2>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#shapes-from-image">level 1</a> section.</p>
   <p class="issue" id="issue-6be62083"><a class="self-link" href="#issue-6be62083"></a> One <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16716">suggestion</a> is to define a shape based on an element’s rendered content.
	This could have security implications.</p>
   <p class="issue" id="issue-4c8c789e"><a class="self-link" href="#issue-4c8c789e"></a> Another <a href="http://lists.w3.org/Archives/Public/www-style/2014Mar/0120.html">suggestion</a> is to add something to an image() function
	that determines the relevant pixels to use
	(both for defining a shape and for display).</p>
   <h2 class="heading settled" data-level="7" id="shapes-from-box-values"><span class="secno">7. </span><span class="content"> Shapes from Box Values</span><a class="self-link" href="#shapes-from-box-values"></a></h2>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#shapes-from-box-values">level 1</a> section.</p>
   <h2 class="heading settled" data-level="8" id="declaring-shapes"><span class="secno">8. </span><span class="content"> Declaring Shapes</span><a class="self-link" href="#declaring-shapes"></a></h2>
   <p>A shape can be declared with
	the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside" id="ref-for-propdef-shape-outside②">shape-outside</a> property,
	with possible modifications
	from the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin" id="ref-for-propdef-shape-margin">shape-margin</a> property.
	The shape defined by
	the <span class="property" id="ref-for-propdef-shape-outside③">shape-outside</span> and <span class="property" id="ref-for-propdef-shape-margin①">shape-margin</span> properties
	changes the geometry
	of a float element’s <span>float area</span> and an exclusion element’s <span>exclusion area</span>.</p>
   <p>A shape can be declared with
	the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside②">shape-inside</a> property,
	with possible modifications
	from the <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding">shape-padding</a> property.
	The shape defined by
	the <span class="property" id="ref-for-propdef-shape-inside③">shape-inside</span> and <span class="property" id="ref-for-propdef-shape-padding①">shape-padding</span> properties
	defines an <span>exclusion area</span> that contributes
	to the element’s <span>wrapping context</span>.
	The <span class="property" id="ref-for-propdef-shape-inside④">shape-inside</span> property applies
	to all block-level elements.</p>
   <div class="example" id="example-c8f2dc07">
    <a class="self-link" href="#example-c8f2dc07"></a> 
    <p>The red box illustrates
		an exclusion element’s content box,
		which is unmodified and subject
		to normal CSS positioning
		(here absolute positioning).</p>
<pre><code class="html">&lt;style type="text/css">
.exclusion  {
    wrap-flow: both;
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    shape-outside: circle(50% at 50% 50%);
    border: 1px solid red;
}
&lt;/style>

&lt;div style=”position: relative;”>
&lt;div class=”exclusion”>&lt;/div>
Lorem ipsum dolor sit amet...
&lt;/div>
</code></pre>
    <p><img alt="Example rendering of circle shape and box model." class="singleImgExample" src="images/shapes_CSS2.1_MBP.png" style="max-width:40%"></p>
   </div>
   <h3 class="heading settled" data-level="8.1" id="shape-outside-property"><span class="secno">8.1. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside" id="ref-for-propdef-shape-outside④">shape-outside</a> Property</span><a class="self-link" href="#shape-outside-property"></a></h3>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#shape-outside-property">level 1</a> section with the change that
	shape-outside applies
	to block-level elements
	and has an effect
	if the element
	is an exclusion.</p>
   <h3 class="heading settled" data-level="8.2" id="shape-inside-property"><span class="secno">8.2. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑤">shape-inside</a> Property</span><a class="self-link" href="#shape-inside-property"></a></h3>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑥">shape-inside</a> property adds
	one or more exclusion areas
	to the element’s wrapping context.
	This modifies the normal rectangular shape
	of the content area
	to a possibly non-rectangular wrapping area.
	The exclusion areas
	are defined by subtracting the shape
	from the element’s content area.
	Any part of the shape outside
	the element’s content area
	has no effect.</p>
   <table class="def propdef" data-link-for-hint="shape-inside">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-inside">shape-inside</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> outside-shape <span id="ref-for-comb-one①">|</span> [ <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape">&lt;basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-any" id="ref-for-comb-any">||</a> shape-box ] <span id="ref-for-comb-one②">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image">&lt;image></a> <span id="ref-for-comb-one③">|</span> display 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>auto 
     <tr>
      <th>Applies to:
      <td>block-level elements 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>computed lengths for <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape①">&lt;basic-shape></a>, the absolute URI for <a class="production css" data-link-type="type" href="#typedef-uri" id="ref-for-typedef-uri">&lt;uri></a>, otherwise as specified
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>as defined for <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape②">&lt;basic-shape></a>, otherwise discrete 
   </table>
   <p>The values of this property have the following meanings:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="shape-inside" data-dfn-type="value" data-export id="valdef-shape-inside-auto"><a class="css" data-link-type="maybe" href="#valdef-shape-inside-auto" id="ref-for-valdef-shape-inside-auto">auto</a></dfn>
    <dd> The shape is computed based on the content box of the element. 
   </dl>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="shape-inside" data-dfn-type="value" data-export id="valdef-shape-inside-outside-shape"><a class="css" data-link-type="maybe" href="#valdef-shape-inside-outside-shape" id="ref-for-valdef-shape-inside-outside-shape">outside-shape</a></dfn>
    <dd> The shape is computed based on
			the shape defined by the shape-outside
			and shape-margin properties. 
   </dl>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-basic-shape">&lt;basic-shape></dfn>
    <dd> The shape is computed based
			on the values of one of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-shapes-1/#funcdef-inset" id="ref-for-funcdef-inset">inset()</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-shapes-1/#funcdef-circle" id="ref-for-funcdef-circle">circle()</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse" id="ref-for-funcdef-ellipse">ellipse()</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-shapes-1/#funcdef-polygon" id="ref-for-funcdef-polygon">polygon()</a>. 
   </dl>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-uri">&lt;uri></dfn>
    <dd>
      If the &lt;uri> references an SVG shape element,
			that element defines the shape.
			Otherwise, if the &lt;uri> references an image,
			the shape is extracted and computed
			based on the alpha channel
			of the specified image. 
     <p>If the &lt;uri> does not reference
			an SVG shape element or an image,
			the effect is as if the value <a class="css" data-link-type="maybe" href="#valdef-shape-inside-auto" id="ref-for-valdef-shape-inside-auto①">auto</a> had been specified.</p>
   </dl>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="shape-inside" data-dfn-type="value" data-export id="valdef-shape-inside-display"><a class="css" data-link-type="maybe" href="#valdef-shape-inside-display" id="ref-for-valdef-shape-inside-display">display</a></dfn>
    <dd> The shape is computed based on the shape of the display
			as described in <a href="https://drafts.csswg.org/css-round-display">css-round-display</a>. 
   </dl>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑦">shape-inside</a> property applies to floats.</p>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑧">shape-inside</a> property may not apply on some elements
	such as elements with a computed <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display</a> value of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table" id="ref-for-valdef-display-table">table</a>.</p>
   <div class="figure">
     <img alt="Content flowing with and without a shape-inside" src="images/shape-inside-content.png"> 
    <p class="caption">Effect of shape-inside on inline content.</p>
   </div>
   <p>Overflow content avoids
	the exclusion area(s) added
	by <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑨">shape-inside</a> and <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding②">shape-padding</a> (as well as any other exclusion areas
	in the element’s wrapping context).
	In other words,
	overflow continues outside
	the rectangular bounds of the element.</p>
   <p></p>
   <div class="figure">
     <img alt="Overflow interacting with rounded rect" src="images/rounded-rect-overflow.png" style="display:inline-block;vertical-align:top"> <img alt="Overflow interacting with ellipse" src="images/ellipse-overflow.png" style="display:inline-block;vertical-align:top"> 
    <p class="caption"> Overflow interacting with exclusion areas defined
			by <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside①⓪">shape-inside</a> and <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding③">shape-padding</a>. </p>
   </div>
   <p class="issue" id="issue-4b8109ae"><a class="self-link" href="#issue-4b8109ae"></a> improve the illustration above,
	using text to show overflow instead of greeked boxes.</p>
   <p>When a shape-inside has a definite size
	(no percentages used in the shape’s definition)
	an auto-sized element should use the shape
	as a constraint in determining its maximum size.</p>
   <h3 class="heading settled" data-level="8.3" id="shape-image-threshold-property"><span class="secno">8.3. </span><span class="content"> The shape-image-threshold Property</span><a class="self-link" href="#shape-image-threshold-property"></a></h3>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#shape-image-threshold-property">level 1</a> section with the change that
	it applies to both <span>shape-inside</span> and <span>shape-outside</span>.</p>
   <h3 class="heading settled" data-level="8.4" id="shape-image-source-type-property"><span class="secno">8.4. </span><span class="content"> The shape-image-source-type Property</span><a class="self-link" href="#shape-image-source-type-property"></a></h3>
   <p>Should we add an alpha/luminance switch
	to determine which values we use
	from the shape-image source?
	This could just be a keyword
	on the shape-image-threshold property.
	Whatever we go with should be compatible
	with the alpha/luminance switch from mask sources.</p>
   <h3 class="heading settled" data-level="8.5" id="shape-margin-property"><span class="secno">8.5. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin" id="ref-for-propdef-shape-margin②">shape-margin</a> property</span><a class="self-link" href="#shape-margin-property"></a></h3>
   <p>Add the final <a href="https://www.w3.org/TR/css-shapes/#shape-margin-property">level 1</a> section with the change that it applies to exclusions.</p>
   <h3 class="heading settled" data-level="8.6" id="shape-padding-property"><span class="secno">8.6. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding④">shape-padding</a> Property</span><a class="self-link" href="#shape-padding-property"></a></h3>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding⑤">shape-padding</a> property adds padding to a shape-inside.
	This defines a new shape where every point
	is the specified distance from the shape-inside.
	This property takes on positive values only.</p>
   <table class="def propdef" data-link-for-hint="shape-padding">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-padding">shape-padding</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none 
     <tr>
      <th>Applies to:
      <td>block-level elements 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>the absolute length 
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value 
   </table>
   <div class="example" id="example-a3dacae1">
    <a class="self-link" href="#example-a3dacae1"></a> 
    <p>A <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding⑥">shape-padding</a> creating an offset
			from a circlular shape-inside.
			The light blue rectangles represent
			inline content affected
			by the shape created
			by the padding.</p>
     <img alt="Example of a shape-padding offset" src="images/shape-padding.png"> 
   </div>
   <p class="note" role="note"><span>Note:</span> The <a class="property" data-link-type="propdesc" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding⑦">shape-padding</a> property
	only affects layout of content
	inside the element it applies to
	while the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin" id="ref-for-propdef-shape-margin③">shape-margin</a> property
	only affects layout of content
	outside the element.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#valdef-shape-inside-auto">auto</a><span>, in §8.2</span>
   <li><a href="#typedef-basic-shape">&lt;basic-shape></a><span>, in §8.2</span>
   <li><a href="#content-area">Content area</a><span>, in §2</span>
   <li><a href="#valdef-shape-inside-display">display</a><span>, in §8.2</span>
   <li><a href="#valdef-path-evenodd">evenodd</a><span>, in §4.1</span>
   <li><a href="#exclusion-area">Exclusion area</a><span>, in §2</span>
   <li><a href="#valdef-path-fill-rule">&lt;fill-rule></a><span>, in §4.1</span>
   <li><a href="#float-area">Float area</a><span>, in §2</span>
   <li><a href="#valdef-path-nonzero">nonzero</a><span>, in §4.1</span>
   <li><a href="#valdef-shape-inside-outside-shape">outside-shape</a><span>, in §8.2</span>
   <li><a href="#funcdef-path">path()</a><span>, in §4.1</span>
   <li><a href="#propdef-shape-inside">shape-inside</a><span>, in §8.2</span>
   <li><a href="#propdef-shape-padding">shape-padding</a><span>, in §8.6</span>
   <li><a href="#valdef-path-string">&lt;string></a><span>, in §4.1</span>
   <li><a href="#typedef-uri">&lt;uri></a><span>, in §8.2</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-border-box">
   <a href="https://drafts.csswg.org/css-box-3/#border-box">https://drafts.csswg.org/css-box-3/#border-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-border-box">2. 
Terminology</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-margin-box">
   <a href="https://drafts.csswg.org/css-box-3/#margin-box">https://drafts.csswg.org/css-box-3/#margin-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-margin-box">2. 
Terminology</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-display">
   <a href="https://drafts.csswg.org/css-display-3/#propdef-display">https://drafts.csswg.org/css-display-3/#propdef-display</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-display">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-table">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-table">https://drafts.csswg.org/css-display-3/#valdef-display-table</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-table">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-fill-rule">
   <a href="https://drafts.csswg.org/css-shapes-1/#typedef-fill-rule">https://drafts.csswg.org/css-shapes-1/#typedef-fill-rule</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-fill-rule">4.1. 
Supported Shapes</a> <a href="#ref-for-typedef-fill-rule①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-circle">
   <a href="https://drafts.csswg.org/css-shapes-1/#funcdef-circle">https://drafts.csswg.org/css-shapes-1/#funcdef-circle</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-circle">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-ellipse">
   <a href="https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse">https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-ellipse">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-inset">
   <a href="https://drafts.csswg.org/css-shapes-1/#funcdef-inset">https://drafts.csswg.org/css-shapes-1/#funcdef-inset</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-inset">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-polygon">
   <a href="https://drafts.csswg.org/css-shapes-1/#funcdef-polygon">https://drafts.csswg.org/css-shapes-1/#funcdef-polygon</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-polygon">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-shape-margin">
   <a href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin">https://drafts.csswg.org/css-shapes-1/#propdef-shape-margin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-margin">8. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-margin①">(2)</a>
    <li><a href="#ref-for-propdef-shape-margin②">8.5. 
The shape-margin property</a>
    <li><a href="#ref-for-propdef-shape-margin③">8.6. 
The shape-padding Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-shape-outside">
   <a href="https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside">https://drafts.csswg.org/css-shapes-1/#propdef-shape-outside</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-outside">2. 
Terminology</a> <a href="#ref-for-propdef-shape-outside①">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside②">8. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-outside③">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside④">8.1. 
The shape-outside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-length-value">
   <a href="https://drafts.csswg.org/css-values-3/#length-value">https://drafts.csswg.org/css-values-3/#length-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-length-value">8.6. 
The shape-padding Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-string-value">
   <a href="https://drafts.csswg.org/css-values-3/#string-value">https://drafts.csswg.org/css-values-3/#string-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-string-value">4.1. 
Supported Shapes</a> <a href="#ref-for-string-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-comma">
   <a href="https://drafts.csswg.org/css-values-4/#comb-comma">https://drafts.csswg.org/css-values-4/#comb-comma</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-comma">4.1. 
Supported Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-opt">
   <a href="https://drafts.csswg.org/css-values-4/#mult-opt">https://drafts.csswg.org/css-values-4/#mult-opt</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-opt">4.1. 
Supported Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">8.2. 
The shape-inside Property</a> <a href="#ref-for-comb-one①">(2)</a> <a href="#ref-for-comb-one②">(3)</a> <a href="#ref-for-comb-one③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-any">
   <a href="https://drafts.csswg.org/css-values-4/#comb-any">https://drafts.csswg.org/css-values-4/#comb-any</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-any">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-image">
   <a href="https://drafts.csswg.org/css-images-3/#typedef-image">https://drafts.csswg.org/css-images-3/#typedef-image</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-image">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-box-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-border-box" style="color:initial">border box</span>
     <li><span class="dfn-paneled" id="term-for-margin-box" style="color:initial">margin box</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-display-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-display" style="color:initial">display</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-table" style="color:initial">table</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS-SHAPES]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-fill-rule" style="color:initial">&lt;fill-rule></span>
     <li><span class="dfn-paneled" id="term-for-funcdef-circle" style="color:initial">circle()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-ellipse" style="color:initial">ellipse()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-inset" style="color:initial">inset()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-polygon" style="color:initial">polygon()</span>
     <li><span class="dfn-paneled" id="term-for-propdef-shape-margin" style="color:initial">shape-margin</span>
     <li><span class="dfn-paneled" id="term-for-propdef-shape-outside" style="color:initial">shape-outside</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-length-value" style="color:initial">&lt;length></span>
     <li><span class="dfn-paneled" id="term-for-string-value" style="color:initial">&lt;string></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-comb-comma" style="color:initial">,</span>
     <li><span class="dfn-paneled" id="term-for-mult-opt" style="color:initial">?</span>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
     <li><span class="dfn-paneled" id="term-for-comb-any" style="color:initial">||</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css3-images]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-image" style="color:initial">&lt;image></span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-box-3">[CSS-BOX-3]
   <dd>Elika Etemad. <a href="https://www.w3.org/TR/css-box-3/">CSS Box Model Module Level 3</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/css-box-3/">https://www.w3.org/TR/css-box-3/</a>
   <dt id="biblio-css-display-3">[CSS-DISPLAY-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-display-3/">CSS Display Module Level 3</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-display-3/">https://www.w3.org/TR/css-display-3/</a>
   <dt id="biblio-css-shapes">[CSS-SHAPES]
   <dd>Vincent Hardy; Rossen Atanassov; Alan Stearns. <a href="https://www.w3.org/TR/css-shapes-1/">CSS Shapes Module Level 1</a>. 20 March 2014. CR. URL: <a href="https://www.w3.org/TR/css-shapes-1/">https://www.w3.org/TR/css-shapes-1/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css3-images">[CSS3-IMAGES]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css3-images/">CSS Image Values and Replaced Content Module Level 3</a>. 17 April 2012. CR. URL: <a href="https://www.w3.org/TR/css3-images/">https://www.w3.org/TR/css3-images/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside①①">shape-inside</a>
      <td>auto | outside-shape | [ &lt;basic-shape> || shape-box ] | &lt;image> | display
      <td>auto
      <td>block-level elements
      <td>no
      <td>n/a
      <td>as defined for &lt;basic-shape>, otherwise discrete
      <td>per grammar
      <td>computed lengths for &lt;basic-shape>, the absolute URI for &lt;uri>, otherwise as specified
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-padding" id="ref-for-propdef-shape-padding⑧">shape-padding</a>
      <td>&lt;length>
      <td>none
      <td>block-level elements
      <td>no
      <td>n/a
      <td>by computed value
      <td>per grammar
      <td>the absolute length
   </table>
  </div>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> One <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16716">suggestion</a> is to define a shape based on an element’s rendered content.
	This could have security implications.<a href="#issue-6be62083"> ↵ </a></div>
   <div class="issue"> Another <a href="http://lists.w3.org/Archives/Public/www-style/2014Mar/0120.html">suggestion</a> is to add something to an image() function
	that determines the relevant pixels to use
	(both for defining a shape and for display).<a href="#issue-4c8c789e"> ↵ </a></div>
   <div class="issue"> improve the illustration above,
	using text to show overflow instead of greeked boxes.<a href="#issue-4b8109ae"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="content-area">
   <b><a href="#content-area">#content-area</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-content-area">2. 
Terminology</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-path-nonzero">
   <b><a href="#valdef-path-nonzero">#valdef-path-nonzero</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-path-nonzero">4.1. 
Supported Shapes</a> <a href="#ref-for-valdef-path-nonzero①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-path-evenodd">
   <b><a href="#valdef-path-evenodd">#valdef-path-evenodd</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-path-evenodd">4.1. 
Supported Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-inside">
   <b><a href="#propdef-shape-inside">#propdef-shape-inside</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-inside">1. 
Introduction</a>
    <li><a href="#ref-for-propdef-shape-inside①">2. 
Terminology</a>
    <li><a href="#ref-for-propdef-shape-inside②">8. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-inside③">(2)</a> <a href="#ref-for-propdef-shape-inside④">(3)</a>
    <li><a href="#ref-for-propdef-shape-inside⑤">8.2. 
The shape-inside Property</a> <a href="#ref-for-propdef-shape-inside⑥">(2)</a> <a href="#ref-for-propdef-shape-inside⑦">(3)</a> <a href="#ref-for-propdef-shape-inside⑧">(4)</a> <a href="#ref-for-propdef-shape-inside⑨">(5)</a> <a href="#ref-for-propdef-shape-inside①⓪">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-inside-auto">
   <b><a href="#valdef-shape-inside-auto">#valdef-shape-inside-auto</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-inside-auto">8.2. 
The shape-inside Property</a> <a href="#ref-for-valdef-shape-inside-auto①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-inside-outside-shape">
   <b><a href="#valdef-shape-inside-outside-shape">#valdef-shape-inside-outside-shape</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-inside-outside-shape">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-basic-shape">
   <b><a href="#typedef-basic-shape">#typedef-basic-shape</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-basic-shape">8.2. 
The shape-inside Property</a> <a href="#ref-for-typedef-basic-shape①">(2)</a> <a href="#ref-for-typedef-basic-shape②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-uri">
   <b><a href="#typedef-uri">#typedef-uri</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-uri">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-inside-display">
   <b><a href="#valdef-shape-inside-display">#valdef-shape-inside-display</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-inside-display">8.2. 
The shape-inside Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-padding">
   <b><a href="#propdef-shape-padding">#propdef-shape-padding</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-padding">8. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-padding①">(2)</a>
    <li><a href="#ref-for-propdef-shape-padding②">8.2. 
The shape-inside Property</a> <a href="#ref-for-propdef-shape-padding③">(2)</a>
    <li><a href="#ref-for-propdef-shape-padding④">8.6. 
The shape-padding Property</a> <a href="#ref-for-propdef-shape-padding⑤">(2)</a> <a href="#ref-for-propdef-shape-padding⑥">(3)</a> <a href="#ref-for-propdef-shape-padding⑦">(4)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>